package com.cy.ppj.model.enums;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

import com.cy.ppj.model.vo.ProductAndAnnouncementTypeVO;

import lombok.Getter;

/**
 * 产品与公告类型
 *
 * @author: tanyilin
 * @create: 2018年10月15日 下午4:15:13
 */
public enum ProductAndAnnouncementType {

	PRODUCT_NOTICE("产品通知"),
	PLATFORM_ANNOUNCEMENT("平台公告")
	;
	
	@Getter
	private String text;

	private ProductAndAnnouncementType(String text) {
		this.text = text;
	}
	
	private static final List<ProductAndAnnouncementTypeVO> voList;
	
	static {
		voList = new ArrayList<>();
		Stream.of(ProductAndAnnouncementType.values()).forEach(p -> {
			ProductAndAnnouncementTypeVO vo = new ProductAndAnnouncementTypeVO();
			vo.setType(p);
			vo.setText(p.getText());
			voList.add(vo);
		});
	}
	
	public List<ProductAndAnnouncementTypeVO> getTypeList() {
		return voList;
	}
}
